from app.project.doc_to_recommendation.llm.model.TongyiChat_base_model import TongyiChatBaseModel
from app.project.doc_to_recommendation.llm.register.llm_register import LLM_REGISTER

@LLM_REGISTER.register_model("tongyi_chat_gen_model")
class TongyiChatGenModel(TongyiChatBaseModel):

    def __init__(self, config: dict):
        super().__init__(config)

    def bind_tools_df(self):
        pass

    def agent_calls(self, text, image=None, prompt=None):
        result = super().agent_calls(text, image, prompt)
        print("==============tongyi_gen response===============", result)

        res_tool_calls = result.tool_calls
        content = result.content
        for res_tool_call in res_tool_calls:
            content.update(res_tool_call['args'])
        return content
